The vector projection (also known as the vector resolute, or vector component) of a vector in the direction of a vector (or "of on/onto "), is given by:
where the operator denotes a dot product, is the unit vector in the direction of , is the length of , and is the angle between and .
The other component of (perpendicular to ), called the vector rejection of from , is given by:
Both the vector projection and the vector rejection are vectors. The vector projection of on is the orthogonal projection of onto the straight line defined by . The corresponding vector rejection is the orthogonal projection of onto a plane orthogonal to .
The vector projection of on can be also regarded as the corresponding scalar projection multiplied by .
Contents |
If and are two vectors, the projection of on is the vector with the same direction as and with the length:
When is not known, we can compute using the following property of the dot product :
Thus, the length of can be also computed as follows:
Since is in the same direction as ,
where is the unit vector with the same direction as :
Substituting for |c| defines c in terms of a and b
which is equivalent to either
or[1]
The latter formula is computationally more efficient than the former. Both require two dot products and eventually the multiplication of a scalar by a vector, but the former additionally requires a square root and the division of a vector by a scalar,[2] while the latter additionally requires only the division of a scalar by a scalar.
The orthogonal projection can be represented by a projection matrix. To project a vector onto the unit vector a = (ax, ay, az), it would need to be multiplied with this projection matrix:
The vector projection is an important operation in the Gram-Schmidt orthonormalization of vector space bases. It is also used in the Separating axis theorem to detect if two convex shapes intersect.
|